<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
class History extends CI_Controller
{
	function History()
	{
		parent::__construct();
        $this->load->model('common/common_model');
        $this->load->model('history/history_model');
        
        $this->load->library('Myinfo');
	}
    
	public function index()
	{
        if(!$this->session->userdata('username'))
        {
            redirect(site_url('login'));
            die();
        }	   
        $data = array();
        $userid = $this->session->userdata('uid');
        $user_oasis_orderid = $this->session->userdata('oasis_orderid');
        $c = (int)$this->input->get('c');
        if($c!=$user_oasis_orderid)
        {
            $oasisId = $this->common_model->ww_get_map_user_info($userid, $c);
            if($oasisId)
            {
                $this->session->set_userdata('oasis_orderid', $oasisId['oasis_orderid']);
            }
            else
            {
                redirect(site_url('home'));
                die();
            }
            $user_oasis_orderid = $oasisId['oasis_orderid'];
        }
        $data = $this->myinfo->loadUserinfo($userid, $user_oasis_orderid);
        
    	// header
    	
    	// content
    	$this->load->view('history/history_view', $data);
    	
    	// footer
    }
 }